class test:
    def double_pointer(nums: list[int], val: int) -> int:
        slow, fast = 0, 0
        while (fast < len(nums)):
            if nums[fast] != val:
                nums[slow] = nums[fast]
                slow += 1
            fast += 1
        return slow

    res = double_pointer([3, 2, 3, 1, 2, 3], 3)
    print(f'res={res},legt')
